# Contributor: Sascha Paunovic <azarus@posteo.net>
# Maintainer: Sascha Paunovic <azarus@posteo.net>
pkgname=spectrwm
_pkgname=SPECTRWM_
pkgver=3.4.1
_pkgver=3_4_1
pkgrel=0
pkgdesc="dynamic, configurable tiling window manager for X11"
options="!check" # No testsuite
url="https://github.com/conformal/spectrwm"
arch="all"
license="ISC"
depends="dmenu terminus-font"
makedepends="bsd-compat-headers freetype-dev libxcursor-dev libxft-dev
	libxrandr-dev libxt-dev xcb-util-keysyms-dev xcb-util-wm-dev"
subpackages="$pkgname-doc"
source="https://github.com/conformal/spectrwm/archive/$_pkgname$_pkgver.tar.gz"
builddir="$srcdir/$pkgname-$_pkgname$_pkgver"

build() {
	cd "$builddir"/linux
	make PREFIX="/usr"
}

package() {
	install -Dm644 spectrwm.conf "$pkgdir"/etc/spectrwm.conf
	mkdir "$pkgdir"/etc/spectrwm
	cp spectrwm_*.conf "$pkgdir"/etc/spectrwm/

	# make default config work
	install -Dm755 baraction.sh "$pkgdir"/usr/share/spectrwm/baraction.sh
	install -Dm755 screenshot.sh "$pkgdir"/usr/share/spectrwm/screenshot.sh

	cd linux
	make PREFIX="/usr" DESTDIR="$pkgdir" install

	# remove unneccessary stuff
	rm "$pkgdir"/usr/bin/scrotwm
	# provide convenience symlink
	ln -s "$pkgdir"/usr/bin/spectrwm "$pkgdir"/usr/bin/scrotwm
}

sha512sums="94d468833124b51fa12b29b173126f10f27dd551d599459e4bea589721b3df6f1f0af0ea67326ed3ad462e1203d3bbcb82032ff83abfa0943ec45afd29dedaa6  SPECTRWM_3_4_1.tar.gz"
